package com.controller.vo;

import java.text.SimpleDateFormat;
import java.util.Date;

import org.springframework.beans.BeanUtils;

import com.controller.vo.base.BaseVo;
import com.dao.entity.Apply;
import com.utils.enums.ENUM_SUCESS;

public class ApplyVo extends BaseVo{
	
	private Long customerId;
	
	private String phone;
	
	private String userName;
	
	private String idCard;

	/**
	 * 年龄
	 */
	private Integer age;
	
	/**
	 * 贷款年限
	 */
	private Integer loanAge;
	
	/**
	 * 房龄
	 */
	private Integer houseAge;
	
	/**
	 * 出让地、划拨地
	 */
	private String landType;
	
	/**
	 * 是否经济适用房
	 */
	private Integer isEconomize;
	
	/**
	 * 是否完成
	 */
	private Integer isComplete;
	
	/**
	 * 客户姓名
	 */
	private String customerName;
	
	private Long commisId;
	
	/**
	 * 公积金类型
	 */
	private String fund;
	
	/**
	 * 工资流水
	 */
	private String wages;
	
	/**
	 * 贷款金额
	 */
	private Double money;
	
	private String creditFile;
	
	private String otherFile;
	
	private int sex;
	
	private Long bankId;
	
	private String bankName;
	
	public ApplyVo() {
		this.isComplete = ENUM_SUCESS.NO.value;
	}
	
	public ApplyVo(Apply a) {
		if(a != null)
			BeanUtils.copyProperties(a, this);
	}
	
	public Apply toPo() {
		Apply a = new Apply();
		BeanUtils.copyProperties(this, a, "updatedate", "createdate");
		return a;
	}
	
	public Integer getAge() {
		return age;
	}

	public void setAge(Integer age) {
		this.age = age;
	}

	public Integer getLoanAge() {
		return loanAge;
	}

	public void setLoanAge(Integer loanAge) {
		this.loanAge = loanAge;
	}

	public Integer getHouseAge() {
		return houseAge;
	}

	public void setHouseAge(Integer houseAge) {
		this.houseAge = houseAge;
	}

	public String getLandType() {
		return landType;
	}

	public void setLandType(String landType) {
		this.landType = landType;
	}

	public Integer getIsEconomize() {
		return isEconomize;
	}

	public void setIsEconomize(Integer isEconomize) {
		this.isEconomize = isEconomize;
	}

	public Long getCustomerId() {
		return customerId;
	}

	public void setCustomerId(Long customerId) {
		this.customerId = customerId;
	}

	public Integer getIsComplete() {
		return isComplete;
	}

	public void setIsComplete(Integer isComplete) {
		this.isComplete = isComplete;
	}

	public String getCustomerName() {
		return customerName;
	}

	public void setCustomerName(String customerName) {
		this.customerName = customerName;
	}

	public Long getCommisId() {
		return commisId;
	}

	public void setCommisId(Long commisId) {
		this.commisId = commisId;
	}

	public String getFund() {
		return fund;
	}

	public void setFund(String fund) {
		this.fund = fund;
	}

	public String getWages() {
		return wages;
	}

	public void setWages(String wages) {
		this.wages = wages;
	}

	public Double getMoney() {
		return money;
	}

	public void setMoney(Double money) {
		this.money = money;
	}

	public String getCreditFile() {
		return creditFile;
	}

	public void setCreditFile(String creditFile) {
		this.creditFile = creditFile;
	}

	public String getOtherFile() {
		return otherFile;
	}

	public void setOtherFile(String otherFile) {
		this.otherFile = otherFile;
	}

	public int getSex() {
		return sex;
	}

	public void setSex(int sex) {
		this.sex = sex;
	}
	
	public Long getBankId() {
		return bankId;
	}

	public void setBankId(Long bankId) {
		this.bankId = bankId;
	}

	public String getBankName() {
		return bankName;
	}

	public void setBankName(String bankName) {
		this.bankName = bankName;
	}

	public String getSexText() {
		switch (this.sex){
		case 1:
			return "男";
		case 0:
			return "女";
		}
		return "女";
	}
	
	public String getCreateText() {
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm");
		return sdf.format(new Date(getCreatedate()));
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getIdCard() {
		return idCard;
	}

	public void setIdCard(String idCard) {
		this.idCard = idCard;
	}
	
}
